how to make factorial program in python using function